Skip to content

Allow jq and ls in review, steer JSON queries to jq#31

Merged
gobetti merged 1 commit into
mainfrom
allow-jq-ls-readonly-json
Jul 9, 2026
Merged

Allow jq and ls in review, steer JSON queries to jq#31
gobetti merged 1 commit into
mainfrom
allow-jq-ls-readonly-json

Conversation

@gobetti

@gobetti gobetti commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Reviews of JSON-heavy repos (survey / connection-flow definitions) kept reaching for python -c "import json; ..." to parse and query deeply nested files. python is denied — it's arbitrary code execution, against this review's read-only contract — so each attempt cost a turn plus a retry, and with python blocked the model fell back to many granular cat/grep calls, inflating turn usage on exactly the files that most need structural queries.

jq is the right tool for that need: a read-only JSON query language that can't execute code, so it fits the contract. This adds jq (and ls) to the allow-list, lists both in the environment note, and tells the model to use jq for JSON and that python/node are unavailable so it stops probing for them. python stays denied.

Evidence: reproducing a connection-flow review (.cf.json, deeply nested) with the current allow-list took ~34 turns of cat/grep thrash; with jq available and the steer in place, the same review used jq 17 times, made 0 python attempts, 0 denials, and finished in 22 turns.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing Done

Prompt + allow-list change to the shared review workflow; no functional/schema change. Validated the workflow YAML parses. jq/ls are read-only and re-expose nothing beyond what the Read/Grep tools already permit; builds/tests/installs/edits/network/python remain denied. Turn-count effect confirmed by local reproduction (above); will confirm on live reviews.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation as needed

Reviews of JSON-heavy repos (survey/connection-flow definitions)
kept reaching for `python -c "import json; ..."` to parse and query
deeply nested files. python is denied — it is arbitrary code
execution, against this review's read-only contract — so each
attempt cost a turn plus a retry, and with python blocked the model
fell back to many granular cat/grep calls, inflating turn usage on
exactly the files that need structural queries.

jq is the right tool for that need: a read-only JSON query language
that cannot execute code, so it fits the contract. Add it (and `ls`)
to the allow-list, list both in the environment note, and tell the
model to use jq for JSON and that python/node are unavailable so it
stops probing for them. python stays denied.

@LandonS23 LandonS23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve — clean addition.

jq is the right tool for JSON-heavy repos: read-only query language, no arbitrary code execution, fits the review contract. The allow-list addition (Bash(jq:*), Bash(ls:*)) and the prompt steer ("use jq for JSON, python/node NOT available") are minimal and well-targeted. 34→22 turns is a solid improvement.

@gobetti gobetti merged commit c5243af into main Jul 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants